package com.cjh.mybatis10.executor;

import com.cjh.mybatis10.mapping.BoundSql;
import com.cjh.mybatis10.mapping.MappedStatement;
import com.cjh.mybatis10.session.ResultHandler;
import com.cjh.mybatis10.session.RowBounds;
import com.cjh.mybatis10.transaction.Transaction;

import java.sql.SQLException;
import java.util.List;

/**
 * @Descripton 执行器
 * @Author cjh
 * @Date 2023/6/1 10:26
 */
public interface Executor {
    ResultHandler NO_RESULT_HANDLER =null;
    <E>List<E> query (MappedStatement mappedStatement, Object parameter, RowBounds rowBounds,
                      ResultHandler resultHandler, BoundSql boundSql);
    Transaction getTransaction();
    void commit(boolean required) throws SQLException;
    void rollback(boolean required) throws SQLException;
    void close(boolean forceRollBack);
}
